home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_imp1_pistons.cog < prev    next >
Text File  |  1999-11-15  |  11KB  |  337 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_IMP1_Pistons.cog
  4. #
  5. # [SXC]
  6. #
  7. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered
  14.     message     pulse
  15.     message     touched
  16.     
  17.     message     user0       # right imp part inserted
  18.     message     user1       # wrong part inserted
  19.     message     user2       # no part inserted
  20.     
  21.     cog         elevcog0
  22.     cog         elevcog1
  23.     cog         elevcog2
  24.     cog         elevcog3
  25.     cog         elevcog4
  26.     cog         elevcog5
  27.     cog         elevcog6
  28.     cog         elevcog7
  29.     cog         elevcog8
  30.     
  31.     thing       player                                      local
  32.     thing       actorindy
  33.     
  34.     thing       piston0                                     linkid=5
  35.     thing       piston1                                     linkid=5
  36.     thing       piston2                                     linkid=5
  37.     thing       piston3                                     linkid=5
  38.     thing       piston4                                     linkid=5
  39.     
  40.     thing       ptarget0
  41.     thing       ptarget1
  42.     thing       ptarget2
  43.     thing       ptarget3
  44.     thing       ptarget4
  45.     
  46.     thing       lightning_strike                            local
  47.     thing       strike_sector                               local
  48.     
  49.     thing       camera_tgt0
  50.     thing       camera_pos0
  51.     
  52.     keyframe    inShocked=in_activate_medium_shock.key        local
  53.     
  54.     template    sparks=bluesparks                              local
  55.     template    smoke0=+pistol_smoke1                        local
  56.     template    lightzap=+lightningzap                        local
  57.     template    lighthit=+lightninghit                        local
  58.     
  59.     material    lightningmat0=inf_4sfx_lightning_a.mat        local
  60.     material    lightningmat1=inf_4sfx_lightning_b.mat        local
  61.     material    lightningmat2=inf_4sfx_lightning_c.mat        local
  62.     material    lightningmat3=inf_4sfx_lightning_d.mat        local
  63.         
  64.     sector      triggersector
  65.     sector      current_sector                              local
  66.     
  67.     sector      cylinder0                                   linkid=3
  68.     sector      cylinder1                                   linkid=3
  69.     sector      cylinder2                                   linkid=3
  70.     sector      cylinder3                                   linkid=3
  71.     sector      cylinder4                                   linkid=3
  72.     
  73.     sector      safeportal0                                 linkid=4
  74.     sector      safeportal1                                 linkid=4
  75.     
  76.     int         testhack=0                                  local
  77.     int         pulsetime=2                                 local
  78.     int         cnt=0                                       local
  79.     int         curcyl_indy=0                               local
  80.     int         in_cylinders=0                              local
  81.     int         rumbler_on=0                                local
  82.     int         killit=0                                    local
  83.     int         count                                       local
  84.     int         cyl                                         local
  85.     
  86.     vector      player_pos                                  local
  87.     
  88.     sound        contact0=gen_lightning_contact_c.wav        local
  89.     sound       contact1=gen_lightning_contact_c.wav        local
  90.     sound       contact2=aet_lightning_04.wav               local
  91.     
  92.     sound       pistonhit=inf_piston_2.wav                  local
  93.     sound       pistonupswing=inf_piston_1.wav              local
  94.     sound       zapdown=fol_gf_attack.wav                   local
  95.     sound       powerdwn=imp5_powerdown.wav                 local
  96.     sound       workedline=INXJ111.wav                      local
  97.       
  98. end
  99.  
  100.  
  101. code
  102. #........................................................................................
  103. startup:
  104.     //inital conditions
  105.  
  106.     player = GetLocalPlayerThing();
  107.     SetPulse(2);
  108.     
  109. return;
  110.  
  111. #........................................................................................
  112. //right part
  113. user0:
  114.  
  115.     rumbler_on = 1;
  116.     //print("IMP1 has been placed");
  117.     SendMessage(elevcog0, user0);
  118.     SendMessage(elevcog1, user0);
  119.     SendMessage(elevcog2, user0);
  120.     SendMessage(elevcog3, user0);
  121.     SendMessage(elevcog4, user0);
  122.     SendMessage(elevcog5, user0);
  123.     SendMessage(elevcog6, user0);
  124.     SendMessage(elevcog7, user0);
  125.     SendMessage(elevcog8, user0);
  126.     
  127.     StartCutscene(1);
  128.     SetActorFlags(player, 0x200000);
  129.     StopThing(player);
  130.     SetCameraFocus(2, camera_pos0);
  131.     SetCameraSecondaryFocus(2, camera_tgt0);
  132.     SetCurrentCamera(2);
  133.     SetCameraFOV(110, 0, 0);
  134.     Sleep(5);
  135.     SetCameraFOV(90, 0, 0);
  136.     
  137.     // return control to the player
  138.     CopyOrientAndPos(actorindy, player);
  139.     SetThingFlags(actorindy, 0x80000);
  140.     ClearThingFlags(player, 0x10);
  141.     ClearThingFlags(player, 0x80000);
  142.     SetCurrentCamera(1);
  143.     SetCameraFOV(90, 0, 0);
  144.     PlayVoice(player, workedline, 1, 1);
  145.     EndCutscene();
  146.     ClearActorFlags(player, 0x200000);
  147.     
  148.     
  149. return;
  150.  
  151. #........................................................................................
  152. //wrong part
  153. user1:
  154.  
  155.     rumbler_on = 0;
  156.     //print("IMP4 has been taken");
  157.     
  158.     StartCutscene(1);
  159.     SetActorFlags(player, 0x200000);
  160.     StopThing(player);
  161.     SetCameraFocus(2, camera_pos0);
  162.     SetCameraSecondaryFocus(2, camera_tgt0);
  163.     SetCurrentCamera(2);
  164.     SetCameraFOV(110, 0, 0);
  165.     //play power up noise
  166.     Sleep(4);
  167.     SetCameraFOV(90, 0, 0);
  168.     
  169.     // return control to the player
  170.     CopyOrientAndPos(actorindy, player);
  171.     SetThingFlags(actorindy, 0x80000);
  172.     ClearActorFlags(player, 0x200000);
  173.     ClearThingFlags(player, 0x10);
  174.     ClearThingFlags(player, 0x80000);
  175.     SetCurrentCamera(1);
  176.     SetCameraFOV(90, 0, 0);
  177.     EndCutscene();
  178.     
  179. return;
  180.  
  181. #........................................................................................
  182. //no part
  183. user2:
  184.  
  185.     rumbler_on = 2;
  186.     //print("There is no part here");
  187.     
  188.     //cut to show cylinders
  189.     StartCutscene(1);
  190.     SetActorFlags(player, 0x200000);
  191.     StopThing(player);
  192.     SetCameraFocus(2, camera_pos0);
  193.     SetCameraSecondaryFocus(2, camera_tgt0);
  194.     SetCurrentCamera(2);
  195.     SetCameraFOV(110, 0, 0);
  196.     //play power down noise
  197.     CreateThing(sparks, piston4);
  198.     sleep(0.5);
  199.     CreateThing(sparks, piston4);
  200.     PlaySoundLocal(zapdown, 1, 0, 0, 1);
  201.     //PlaySoundLocal(powerdwn, 1, 0, 0, 1);
  202.     Sleep(2);
  203.     SetCameraFOV(90, 0, 0);
  204.     
  205.     // return control to the player
  206.     CopyOrientAndPos(actorindy, player);
  207.     SetThingFlags(actorindy, 0x80000);
  208.     ClearActorFlags(player, 0x200000);
  209.     ClearThingFlags(player, 0x10);
  210.     ClearThingFlags(player, 0x80000);
  211.     SetCurrentCamera(1);
  212.     SetCameraFOV(90, 0, 0);
  213.     EndCutscene();
  214.  
  215. return;
  216.  
  217. #........................................................................................
  218.  
  219. entered:
  220.  
  221.     if (GetSenderID() == 4)
  222.     {
  223.         in_cylinders = 0;
  224.         //print("indy is in safe sectors");
  225.     }
  226.  
  227.     if ((GetSenderID() == 3) && (GetSourceRef() == player))
  228.     {
  229.         in_cylinders = 1;
  230.         current_sector=GetThingSector(player);
  231.         if (current_sector == cylinder0)
  232.         {
  233.             curcyl_indy = 0;
  234.             //print("indy is in cylinder0");
  235.             
  236.         }
  237.         if (current_sector == cylinder1)
  238.         {
  239.             curcyl_indy = 1;
  240.             //print("indy is in cylinder1");
  241.             
  242.         }
  243.         if (current_sector == cylinder2)
  244.         {
  245.             curcyl_indy = 2;
  246.             //print("indy is in cylinder2");
  247.             
  248.         }
  249.         if (current_sector == cylinder3)
  250.         {
  251.             curcyl_indy = 3;
  252.             //print("indy is in cylinder3");
  253.     
  254.             
  255.         }
  256.         if (current_sector == cylinder4)
  257.         {
  258.             curcyl_indy = 4;
  259.             //print("indy is in cylinder4");
  260.         }
  261.     }
  262.                                            
  263.     return;
  264.         
  265. #........................................................................................
  266.  
  267. pulse:
  268.  
  269.     //wrong part side effects
  270.     if (rumbler_on == 0) 
  271.     {
  272.         //lightning strikes
  273.         PlaySoundThing(contact0[RandBetween(0, 2)], piston0[count], 1, 5, 10, 0);
  274.         for (cnt = 4; cnt <= RandBetween(4, 8); cnt = cnt + 1)
  275.         {
  276.             lightning_strike = CreatePolylineThing(piston0[count], ptarget0[count], '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  277.             Sleep(0.05); 
  278.         }
  279.         if ((curcyl_indy == count) && (in_cylinders == 1))
  280.             {
  281.                 //print("indy gets hit");
  282.                 SetActorFlags(player, 0x200000);
  283.                 StopThing(player);
  284.                 player_pos = VectorAdd(GetThingPos(player), '0 0 0.05');
  285.                 for (cnt = 4; cnt <= RandBetween(4, 8); cnt = cnt + 71)
  286.                 {
  287.                     CreatePolylineThing(piston0[count], player_pos, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  288.                     Sleep(0.05); 
  289.                 }
  290.                 CreateThingAtPos(sparks, GetThingSector(player), player_pos, '0 0 0');
  291.                 CreateThingAtPos(smoke0, GetThingSector(player), player_pos, '0 0 0');
  292.                 CreateThingAtPos(lighthit, GetThingSector(player), player_pos, '0 0 0');
  293.                 DamageThing(player, 1000, 0x2, piston0[count]);
  294.                 Sleep(1);
  295.                 ClearActorFlags(player, 0x200000);
  296.             }
  297.             count=count+1;
  298.         if (count == 5)
  299.         {
  300.             count = 0;
  301.         }
  302.     }
  303.     
  304.     if (rumbler_on == 1)
  305.     {
  306.         MoveToFrame(piston0[cyl], 1, 6);
  307.         PlaySoundThing(pistonhit, piston0[cyl], 1, 2, 15, 0x80);
  308.         WaitForStop(piston0[cyl]);
  309.         PlaySoundThing(pistonupswing, piston0[cyl], 1, 2, 15, 0x80);
  310.         MoveToFrame(piston0[cyl], 0, 3);
  311.         cyl = cyl + 1;
  312.         if (cyl == 5)
  313.         {
  314.             cyl = 0;
  315.         }
  316.     }
  317.     return;
  318.     
  319. #........................................................................................
  320.  
  321. touched:
  322.  
  323.     If ((GetSenderID() == 5) && (GetSourceRef() == player) && (killit == 0) && (rumbler_on == 1))
  324.     {
  325.         //print("cylinder is blocked");
  326.         DamageThing(player, 1000, 0x80, piston0[count]);
  327.         killit=1;
  328.     }
  329.     
  330. return;
  331.     
  332. #........................................................................................
  333.  
  334. end
  335.  
  336.  
  337.